﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DTO;

namespace DAO
{
    public  class QuyenDAO
    {
        ConnectDB conn = new ConnectDB();
        string str;
        //Load dữ liệu
        public DataTable LoadQuyen()
        {
            return conn.LayDuLieu("select *from Quyen");
        }
        // insert va update
        public void Is_Quyen(QuyenDTO  p)
        {
            string ten = p.TenQuyen;
            str = "INSERT Quyen (TenQuyen) VALUES('" + ten+ "')";
            conn.excute(str);
        }
        //del
        public void Xoa_Quyen(QuyenDTO p)
        {
            string ma = p.MaQuyen;
            str = "DELETE Quyen WHERE MaQuyen='" + ma  + "'";
            conn.excute(str);
        }
    }
}
